<template>
    <view class="content">
        <text class="title">获取最新景点列表数据</text>
        <button @click="updateData()" style="margin-top: 20px">立即更新</button>
    </view>
</template>

<script>
export default {
    data() {
        return {
        }
    },
    onLoad() {

    },
    methods: {
        async updateData() {
            const viewspot = uniCloud.importObject('viewspot')
            const res = await viewspot.updateViewSpotData()
            uni.showToast({
                title: res.msg,
                icon: 'none',
                duration: 2000
            });
        }
    }
}
</script>

<style>
.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

</style>
